package tool.zyk.bio;

import java.io.DataInputStream;
import java.io.IOException;
import java.net.Socket;

/**
 * author: zyk
 * datetime: 2024/1/26 23:26
 * describe:
 */
public class BioClient {
    public static void main(String[] args) {
        try {
            /*
             *  localhost
             *  127.0.0.1
             *  具体IP地址
             */
            //1.创建客户端，连接服务端
            Socket socket = new Socket("127.0.0.1",8085);
            //2.数据交互，客户端->输入流
            DataInputStream dataInputStream = new DataInputStream(
                    socket.getInputStream());
            System.out.println(dataInputStream.readUTF());;
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
